describe("practice-8-4",function(){
    it("一共有要用几次可以把狼羊白菜全部运到河对面",function() {
        var arr_result = get_farmer_crossing_the_river();
        expect(arr_result.length).toBe(7);
    });
    it("运最后一次时，河边没有了任何东西",function() {
        var arr_result = get_farmer_crossing_the_river();
        expect(arr_result[arr_result.length-1].riverside.length).toBe(0);
    });
    it("每次运输东西时，羊和白菜或者狼和羊不能同时存在",function() {
        var arr_result = get_farmer_crossing_the_river();
        for(var i = 0;i <arr_result.length; i ++)
        {
            var value = arr_result[i];
            if(value.riverside.length === 2)
            {
                expect(value.riverside[0]=='wolf'||value.riverside[1]=='wolf').toBe(true);
                expect(value.riverside[0]=='cabbage'||value.riverside[1]=='cabbage').toBe(true);
            }
            if(value.across_river.length === 2)
            {
                expect(value.across_river[0]=='wolf'||value.across_river[1]=='wolf').toBe(true);
                expect(value.across_river[0]=='cabbage'||value.across_river[1]=='cabbage').toBe(true);
            }
            expect(value.bring.length <= 1).toBe(true);
        }
    });

});